#!/bin/bash
webVersion="$(cat prod-web.env | grep version= | cut -d '=' -f2)"
echo "read !version=$webVersion!"
export webVersion=$webVersion
docker compose  -f docker-compose-build-pf-web.yml   build
./login-docker.sh

/usr/bin/docker push registry.cn-beijing.aliyuncs.com/dragon_plan_prod/dragon_plan:app_sxkj_web_prod_${webVersion}

if [ "$webVersion"x == "v1"x ]
then
  webVersion="v2"
else
  webVersion="v1"
fi
echo "write !version=$webVersion!"
echo "version=$webVersion" > prod-web.env
